package main

import (
	"fmt"
	"sync"
)

var wg sync.WaitGroup
var count int = 0

func routine(id int) {
	for i := 0; i < 2; i++ {
		value := count
		//time.Sleep(time.Second)
		value++
		count = value
	}
	wg.Done()
}

func main() {

	for i := 1; i <= 2; i++ {
		wg.Add(1)
		go routine(i)
	}

	wg.Wait()
	fmt.Printf("Final Counter: %d\n", count)
}
